package com.xiaobing.common.exception;

/**
 * 自定义异常拦截
 */

public class ServiceException extends RuntimeException {

    private int code = 500;
    private String msg = "服务器异常";

    public ServiceException(ExceptionCodeMsg appExceptioncodeMsg) {
        super();
        this.code = appExceptioncodeMsg.getCode();
        this.msg = appExceptioncodeMsg.getMessage();
    }

    public ServiceException(int code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }

    public ServiceException(String msg) {
        super();
        this.msg = msg;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}